package com.zyh.homework.test11;

import java.util.Locale;

public class Test11 {
    public static void main(String[] args) {
        String str="1、 hello 2. world 3. java 4.String 5. haha 6、HELLO";
        str = str.toUpperCase();
        str = str.replaceAll("[^A-Z]","");
        System.out.println(str);
        int count=0;
        int index=0;
        char[] chs = str.toCharArray();
        for (int i = 0; i < chs.length; i++) {
            while ((index=str.indexOf(chs[i]))!=-1){
                str=str.substring(index+1);
                count++;
            }
        }
        System.out.println("count = " + count);
    }
}
